DECLARE @gutsid AS int

Set @gutsid = 2000

select  REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(RTRIM(LTRIM('EVT_' + payoutname + ','))),' ','_'),'_9,','_NINE,'),'_10,','_TEN,'),'_J,','_JACK,'),'_Q,','_QUEEN,'),'_K,','_KING,'),'_A,','_ACE,') as 'SpinResult' from AUSLOTSGUTSPAYOUTS  where gutsid = @gutsid order by payouttypeid

select REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(RTRIM(LTRIM('ICON_' + iconname + ','))),' ','_'),'_9,','_NINE,'),'_10,','_TEN,'),'_J,','_JACK,'),'_Q,','_QUEEN,'),'_K,','_KING,'),'_A,','_ACE,') as 'WheelContents' from AUSLOTSGUTSICONNAMES where gutsid = @gutsid order by iconid
